package com.zjdiepu.www.manage.api.icbc;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.commons.lang.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.zjdiepu.www.base.BaseController;
import com.zjdiepu.www.base.annotation.Add;
import com.zjdiepu.www.base.annotation.Update;
import com.zjdiepu.www.base.core.AbstractSysUser;
import com.zjdiepu.www.base.core.ApiResponse;
import com.zjdiepu.www.base.core.PageVo;
import com.zjdiepu.www.base.enums.status.DpStatus;
import com.zjdiepu.www.base.enums.status.InterviewStatus;
import com.zjdiepu.www.base.enums.status.OpenCardStatus;
import com.zjdiepu.www.base.enums.type.DataDicType;
import com.zjdiepu.www.base.enums.type.OperateType;
import com.zjdiepu.www.base.enums.type.ResultFlagType;
import com.zjdiepu.www.base.enums.type.TypeData;
import com.zjdiepu.www.common.util.CollectionInitUtil;
import com.zjdiepu.www.commpent.mapper.yw.YwBusinessVoMapper;
import com.zjdiepu.www.ibiz.cache.ICachedDictionaryService;
import com.zjdiepu.www.ibiz.icbc.IYwOpenCardHzicbcService;
import com.zjdiepu.www.ibiz.icbc.IYwOpenCardHzicbcSubService;
import com.zjdiepu.www.ibiz.yw.IYwBusinessService;
import com.zjdiepu.www.model.base.dto.SysUser;
import com.zjdiepu.www.model.icbc.dto.YwOpenCardHzicbc;
import com.zjdiepu.www.model.icbc.dto.YwOpenCardHzicbcSub;
import com.zjdiepu.www.model.icbc.ext.YwOpenCardHzicbcExt;
import com.zjdiepu.www.model.icbc.vo.YwOpenCardHzicbcSubVo;
import com.zjdiepu.www.model.yw.dto.YwBusiness;
import com.zjdiepu.www.model.yw.request.YwBusinessQueryRequest;
import com.zjdiepu.www.response.BooleanResponse;
import com.zjdiepu.www.util.PinYinUtil;

/**
 * yw_开卡信息_杭州工行Controller层<br/>
 * @author zhangzhengjian<br/>
 * @time 2017年12月09日 11时48分<br/>
 * @since 1.0<br/>
 */
@RestController
@RequestMapping(value= "YwOpenCardHzicbcController", produces="application/json;charset=UTF-8")
@Api(tags = {"yw_开卡信息_杭州工行"}, produces="application/json;charset=UTF-8")
public class YwOpenCardHzicbcController extends BaseController {
    @Resource
    private IYwOpenCardHzicbcService ywOpenCardHzicbcService;
    @Resource
    private IYwOpenCardHzicbcSubService ywOpenCardHzicbcSubService;
    @Resource
	private IYwBusinessService ywBusinessService;
	@Resource
    private YwBusinessVoMapper ywBusinessVoMapper;
    @Resource
    private ICachedDictionaryService cachedDictionaryService;
    
    @ApiOperation(value = "更新面签成功状态", response = Boolean.class, httpMethod="POST", tags={"新增"})
    @RequestMapping(value = "updateMqSuccess", method = RequestMethod.POST)
    public ApiResponse updateMqSuccess(YwOpenCardHzicbc ywOpenCardHzicbc){
    	AbstractSysUser currentUser = getCurrentUser();
    	YwBusiness ywBusiness=ywBusinessService.selectById(ywOpenCardHzicbc.getBusiId());
    	if(ywBusiness==null){
    		return ApiResponse.fail(ResultFlagType.MISSING);
    	}
    	ywBusiness.setModifier(currentUser.getId());
    	ywBusiness.setModifierName(currentUser.getName());
    	ywBusiness.setInterviewStatus(InterviewStatus.MIAN_QIAN_CHENG_GONG.getCode());
    	ywBusiness.setInterviewTime(new Date());
    	ywBusinessService.saveUpdateAndDelete(ywBusiness, OperateType.edit);
    	return ApiResponse.success(true);
    }
    
    @ApiOperation(value = "更新开卡卡部状态", response = Boolean.class, httpMethod="POST", tags={"新增"})
    @RequestMapping(value = "updateHzicbcOpencardStatus", method = RequestMethod.POST)
    public ApiResponse updateHzicbcOpencardStatus(YwOpenCardHzicbc ywOpenCardHzicbc){
    	
    	ywOpenCardHzicbcService.updateHzicbcOpencardStatus(ywOpenCardHzicbc);
    	return ApiResponse.success(true);
    }
    
    @ApiOperation(value = "提交转线下开卡", response = Boolean.class, httpMethod="POST", tags={"新增"})
    @RequestMapping(value = "updateStopOpenCardStatus", method = RequestMethod.POST)
    public ApiResponse updateStopOpenCardStatus(YwOpenCardHzicbc ywOpenCardHzicbc){
    	
    	AbstractSysUser currentUser = getCurrentUser();
    	ywOpenCardHzicbcService.updateStopOpenCardStatus(ywOpenCardHzicbc,currentUser);
    	return ApiResponse.success(true);
    }
    
    @ApiOperation(value = "提交转线下开卡", response = Boolean.class, httpMethod="POST", tags={"新增"})
    @RequestMapping(value = "updateLineOpenCardStatus", method = RequestMethod.POST)
    public ApiResponse updateLineOpenCardStatus(YwOpenCardHzicbc ywOpenCardHzicbc){
    	AbstractSysUser currentUser = getCurrentUser();
    	ywOpenCardHzicbcService.updateLineOpenCardStatus(ywOpenCardHzicbc,currentUser);
    	
    	return ApiResponse.success(true);
    }
    
    @ApiOperation(value = "保存线下开卡", response = Boolean.class, httpMethod="POST", tags={"新增"})
    @RequestMapping(value = "saveopencardLine", method = RequestMethod.POST)
    public ApiResponse saveopencardLine(YwOpenCardHzicbc ywOpenCardHzicbc){
    	AbstractSysUser currentUser = getCurrentUser();
    	ywOpenCardHzicbcService.saveOpencardLine(ywOpenCardHzicbc,currentUser);
    	return ApiResponse.success(true);
    }

    @ApiOperation(value = "提交线下开卡", response = Boolean.class, httpMethod="POST", tags={"新增"})
    @RequestMapping(value = "commitopencardLine", method = RequestMethod.POST)
    public ApiResponse commitopencardLine(YwOpenCardHzicbc ywOpenCardHzicbc){
    	AbstractSysUser currentUser = getCurrentUser();
    	ywOpenCardHzicbcService.updateOpencardLine(ywOpenCardHzicbc,currentUser);
    	return ApiResponse.success(true);
    }
    
    
    @ApiOperation(value = "退回", response = Boolean.class, httpMethod="POST", tags={"新增"})
    @RequestMapping(value = "backOpenCardStatus", method = RequestMethod.POST)
    public ApiResponse backOpenCardStatus(YwOpenCardHzicbc ywOpenCardHzicbc){
    	AbstractSysUser user = getCurrentUser();
    	ywOpenCardHzicbcService.updateBackOpenCardStatus(ywOpenCardHzicbc,user);
    	return ApiResponse.success(true);
    }
    
    @ApiOperation(value = "查询单条信息yw_开卡信息_杭州工行", response = Boolean.class, httpMethod="POST", tags={"新增"})
    @RequestMapping(value = "selectRefined", method = RequestMethod.POST)
    public ApiResponse selectRefined(YwOpenCardHzicbcExt ywOpenCardHzicbcExt){
    	
    	YwOpenCardHzicbc ywOpenCardHzicbc=new YwOpenCardHzicbc();
    	ywOpenCardHzicbc.setBusiId(ywOpenCardHzicbcExt.getBusiId());
    	ywOpenCardHzicbc=ywOpenCardHzicbcService.selectRefined(ywOpenCardHzicbc);
    	return ApiResponse.success(ywOpenCardHzicbc);
    }
    
    @ApiOperation(value = "名字转拼音", response = Boolean.class, httpMethod="POST", tags={"新增"})
    @RequestMapping(value = "toPinYin", method = RequestMethod.POST)
    public ApiResponse toPinYin(String name){
    	String engName=PinYinUtil.toPinYin(name,true,20);
    	return ApiResponse.success(engName);
    }
    /**
     * @author zhangzhengjian <br/>
     * @Title: save  <br/>
     * @Description: 新增yw_开卡信息_杭州工行 <br/>
     * @param ywOpenCardHzicbc
     * @return
     * @version V1.0  <br/>
     */
    @ApiOperation(value = "新增yw_开卡信息_杭州工行", response = Boolean.class, httpMethod="POST", tags={"新增"})
    @RequestMapping(value = "save", method = RequestMethod.POST)
    public ApiResponse save(@Validated(Add.class) @ModelAttribute YwOpenCardHzicbc ywOpenCardHzicbc) {
    	AbstractSysUser currentUser = getCurrentUser();
    	ywOpenCardHzicbc.setModifier(currentUser.getId()); //统一使用修改人和修改人名称来初始化
    	ywOpenCardHzicbc.setModifierName(currentUser.getName());
        ywOpenCardHzicbcService.saveUpdateAndDelete(ywOpenCardHzicbc, OperateType.add);
        return ApiResponse.success(true);
    }
    @ApiOperation(value = "新增yw_开卡信息_杭州工行", response = String.class, httpMethod="POST", tags={"新增"})
    @RequestMapping(value = "insert", method = RequestMethod.POST)
    public ApiResponse insert( YwOpenCardHzicbcSubVo ywOpenCardHzicbc) {
    	AbstractSysUser currentUser = getCurrentUser();
    	ywOpenCardHzicbc.setModifier(currentUser.getId()); //统一使用修改人和修改人名称来初始化
    	ywOpenCardHzicbc.setModifierName(currentUser.getName());
    	ywOpenCardHzicbc.setOpenCardStatus(10);
        ywOpenCardHzicbcService.saveYwOpenCardHzicbc(ywOpenCardHzicbc, currentUser);
        return ApiResponse.success(ywOpenCardHzicbc.getId());
    }
    @ApiOperation(value = "提交yw_开卡信息_杭州工行", response = Boolean.class, httpMethod="POST", tags={"新增"})
    @RequestMapping(value = "commit", method = RequestMethod.POST)
    public ApiResponse commit(@ModelAttribute YwOpenCardHzicbcSub ywOpenCardHzicbc) {
    	AbstractSysUser currentUser = getCurrentUser();
    	ywOpenCardHzicbc.setModifier(currentUser.getId()); //统一使用修改人和修改人名称来初始化
    	ywOpenCardHzicbc.setModifierName(currentUser.getName());
    	
    	
    	YwOpenCardHzicbcSub ywOpenCardHzicbcSub=new YwOpenCardHzicbcSub();
    	ywOpenCardHzicbcSub.setBusiId(ywOpenCardHzicbc.getBusiId());
    	ywOpenCardHzicbcSub.setDpStatus(DpStatus.NORMAL.getCode());
    	ywOpenCardHzicbcSub=ywOpenCardHzicbcSubService.selectRefined(ywOpenCardHzicbcSub);
    	if(ywOpenCardHzicbcSub==null){
    		return ApiResponse.fail(ResultFlagType.MISSING);
    	}
    	//检查空字段
    	Map<String,String> map=checkEmpty(ywOpenCardHzicbcSub);
    	if(map!=null && map.size()>0){
    		return ApiResponse.fail(300000,map.get("emptyKey"));
    	}
    	
		BooleanResponse flag=ywOpenCardHzicbcService.commitYwOpenCardHzicbc(ywOpenCardHzicbc, currentUser);
		if(flag !=null&&flag.getResult()==true){
			return ApiResponse.success(true);
		}
    	return ApiResponse.fail(ResultFlagType.MISSING);
    }
    private Map<String,String> checkEmpty(YwOpenCardHzicbcSub ywOpenCardHzicbcSub) {
    	Map<String,String> map = new HashMap<String,String>();
    	if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getAuthref())){
    		map.put("emptyKey", "发证单位不能为空");
    		
    	}
    	if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getChnsname())){
    		map.put("emptyKey", "客户姓名不能为空");
    		
    	}
    	if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getBusiId())){
    		map.put("emptyKey", "业务id不能为空");
    		
    	}
    	if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getCusId())){
    		map.put("emptyKey", "客户id不能为空");
    		
    	}
    	if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getCustcode())){
    		map.put("emptyKey", "身份证号不能为空");
    		
    	}
    	if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getCustsort())){
    		map.put("emptyKey", "证件类型不能为空");
    		
    	}
    	if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getMrtlstat())){
    		map.put("emptyKey", "婚姻情况不能为空");
    		
    	}
    	if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getEdulvl())){
    		map.put("emptyKey", "教育程度不能为空");
    		
    	}
    	if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getMvblno())){
    		map.put("emptyKey", "手机号码不能为空");
    		
    	}
    	if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getDrawmode())){
    		map.put("emptyKey", "卡片领取方式不能为空");
    		
    	}
    	if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getAccgetm())){
    		map.put("emptyKey", "对帐单寄送方式不能为空");
    		
    	}
    	if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getMamobile())){
    		map.put("emptyKey", "主卡发送移动电话不能为空");
    		
    	}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getSmsphone())){
			map.put("emptyKey", "发送短信帐单手机号码不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getEmladdrf())){
			map.put("emptyKey", "开通email对账单不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getStmtemail())&& ywOpenCardHzicbcSub.getEmladdrf().equals("1")){
			map.put("emptyKey", "对帐单EMAIL不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getMachgf())){
			map.put("emptyKey", "主卡开通余额变动提醒不能为空");
			
		}
		if((StringUtils.isEmpty(ywOpenCardHzicbcSub.getMachgmobile())&& ywOpenCardHzicbcSub.getMachgf().equals("1"))){
			map.put("emptyKey", "主卡余额提醒发送手机号码不能为空");
			
		}
		if(null==ywOpenCardHzicbcSub.getBirthdate()){
			map.put("emptyKey", "出生日期不能为空");
			
		}
		if(null==ywOpenCardHzicbcSub.getStatdate()){
			map.put("emptyKey", "证件有效期不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getEngname())){
			map.put("emptyKey", "英文名不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getHprovince())){
			map.put("emptyKey", "住宅地址省份不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getHcity())){
			map.put("emptyKey", "住宅地址市不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getHcounty())){
			map.put("emptyKey", "住宅地址县不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getHaddress())){
			map.put("emptyKey", "住宅地址不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getHomestat())){
			map.put("emptyKey", "住宅状况不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getHomezip())){
			map.put("emptyKey", "住宅邮编不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getIndate())){
			map.put("emptyKey", "何时入住现址不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getCommprov())){
			map.put("emptyKey", "通讯地址省份不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getCommcity())){
			map.put("emptyKey", "通讯地址市不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getCommcounty())){
			map.put("emptyKey", "通讯地址县不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getCommaddr())){
			map.put("emptyKey", "通讯地址不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getCommazip())){
			map.put("emptyKey", "通讯地址邮编不能为空");
			
		}
		if(null==ywOpenCardHzicbcSub.getJoindate()){
			map.put("emptyKey", "进入单位时间不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getModelcode())){
			map.put("emptyKey", "单位性质不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getReltsex1())){
			map.put("emptyKey", "紧急联系人1性别不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getCprovince())){
			map.put("emptyKey", "单位地址省份不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getCcity())){
			map.put("emptyKey", "单位地址市不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getCcounty())){
			map.put("emptyKey", "单位地址县不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getCaddress())){
			map.put("emptyKey", "单位地址不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getCorpzip())){
			map.put("emptyKey", "单位邮编不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getReltname1())){
			map.put("emptyKey", "联系人一姓名不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getReltship1())){
			map.put("emptyKey", "联系人一与主卡申请关系不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getReltmobl1())){
			map.put("emptyKey", "联系人一手机不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getReltname2())){
			map.put("emptyKey", "联系人二姓名不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getReltsex2())){
			map.put("emptyKey", "联系人二性别不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getReltship2())){
			map.put("emptyKey", "联系人二与主卡申请不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getReltmobl2())){
			map.put("emptyKey", "联系人二手机不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getOccptn())){
			map.put("emptyKey", "职业不能为空");
			
		}
		if(StringUtils.isEmpty(ywOpenCardHzicbcSub.getCcol1())){
			map.put("emptyKey", "单位名称不能为空");
			
		}
		if( null==ywOpenCardHzicbcSub.getYearincome()){
			map.put("emptyKey", "年收入不能为空");
			
	    }
		return map;
    	
		
	}

	@ApiOperation(value = "提交yw_开卡信息_杭州工行待审核", response = Boolean.class, httpMethod="POST", tags={"新增"})
    @RequestMapping(value = "commitDaishenheYwOpenCardHzicbc", method = RequestMethod.POST)
    public ApiResponse commitDaishenheYwOpenCardHzicbc(@ModelAttribute YwOpenCardHzicbcSubVo ywOpenCardHzicbcVo){
      
		AbstractSysUser currentUser = getCurrentUser();

	  	YwOpenCardHzicbcSub ywOpenCardHzicbcSub=new YwOpenCardHzicbcSub();
	  	ywOpenCardHzicbcSub.setBusiId(ywOpenCardHzicbcVo.getBusiId());
	  	ywOpenCardHzicbcSub.setDpStatus(DpStatus.NORMAL.getCode());
	  	ywOpenCardHzicbcSub=ywOpenCardHzicbcSubService.selectRefined(ywOpenCardHzicbcSub);
	  	if(ywOpenCardHzicbcSub==null){
	  		return ApiResponse.fail(ResultFlagType.MISSING);
	  	}
	  	//检查空字段
	  	Map<String,String> map=checkEmpty(ywOpenCardHzicbcSub);
	  	if(map!=null && map.size()>0){
	  		return ApiResponse.fail(300000,map.get("emptyKey"));
	  	}
      
      YwOpenCardHzicbc ywOpenCardHzicbc=new YwOpenCardHzicbc();
      ywOpenCardHzicbc.setBusiId(ywOpenCardHzicbcVo.getBusiId());
      ywOpenCardHzicbc.setDpStatus(DpStatus.NORMAL.getCode());
      ywOpenCardHzicbc=ywOpenCardHzicbcService.selectRefined(ywOpenCardHzicbc);
      if(ywOpenCardHzicbc!=null ){
    	  if(OpenCardStatus.YI_BAO_CUN.getCode().equals(ywOpenCardHzicbc.getOpenCardStatus()) || OpenCardStatus.KAI_KA_SHI_BAI.getCode().equals(ywOpenCardHzicbc.getOpenCardStatus())){
    		  ywOpenCardHzicbc.setModifier(currentUser.getId()); //统一使用修改人和修改人名称来初始化
    		  ywOpenCardHzicbc.setModifierName(currentUser.getName());
    		  ywOpenCardHzicbcService.commitDaishenheYwOpenCardHzicbc(ywOpenCardHzicbc,currentUser);
    	  }else{
    		  return ApiResponse.fail(100300,"请先保存后再提交!");
    	  }
      }
  		return ApiResponse.success(true);
    }
    /**
     * @author zhangzhengjian <br/>
     * @Title: remove  <br/>
     * @Description: 删除yw_开卡信息_杭州工行<br/>
     * @param id
     * @return
     * @version V1.0  <br/>
     */
    @ApiOperation(value = "删除yw_开卡信息_杭州工行", response = Boolean.class, httpMethod="POST", tags={"删除"})
    @ApiImplicitParams({
        @ApiImplicitParam(name = "id", value = "数据主键", paramType="query", required = true, example="1")
    })
    @RequestMapping(value = "remove", method = RequestMethod.POST)
    public ApiResponse remove(String id) {
    	if(StringUtils.isBlank(id)) {
    		return ApiResponse.fail(ResultFlagType.PARAM_EMPTY);
    	}
    	AbstractSysUser currentUser = getCurrentUser();
    	List<String> ids = Arrays.asList(id.split(","));
    	ywOpenCardHzicbcService.updateBatch(currentUser.getId(), currentUser.getName(), DpStatus.DELETED.getCode(), ids);
        return ApiResponse.success(true);
    }
    
    /**
     * @author zhangzhengjian <br/>
     * @Title: disable  <br/>
     * @Description: 禁用yw_开卡信息_杭州工行<br/>
     * @param id
     * @return
     * @version V1.0  <br/>
     */
    @ApiOperation(value = "禁用yw_开卡信息_杭州工行", response = Boolean.class, httpMethod="POST", tags={"禁用"})
    @ApiImplicitParams({
        @ApiImplicitParam(name = "id", value = "数据主键", paramType="query", required = true, example="1")
    })
    @RequestMapping(value = "disable", method = RequestMethod.POST)
    public ApiResponse disable(String id) {
    	if(StringUtils.isBlank(id)) {
    		return ApiResponse.fail(ResultFlagType.PARAM_EMPTY);
    	}
    	AbstractSysUser currentUser = getCurrentUser();
    	List<String> ids = Arrays.asList(id.split(","));
    	ywOpenCardHzicbcService.updateBatch(currentUser.getId(), currentUser.getName(), DpStatus.INVALID.getCode(), ids);
        return ApiResponse.success(true);
    }
    
    /**
     * @author zhangzhengjian <br/>
     * @Title: enable <br/>
     * @Description: 启用yw_开卡信息_杭州工行<br/>
     * @param id
     * @return
     * @version V1.0  <br/>
     */
    @ApiOperation(value = "启用yw_开卡信息_杭州工行", response = Boolean.class, httpMethod="POST", tags={"启用"})
    @ApiImplicitParams({
        @ApiImplicitParam(name = "id", value = "数据主键", paramType="query", required = true, example="1")
    })
    @RequestMapping(value = "enable", method = RequestMethod.POST)
    public ApiResponse enable(String id) {
    	if(StringUtils.isBlank(id)) {
    		return ApiResponse.fail(ResultFlagType.PARAM_EMPTY);
    	}
    	AbstractSysUser currentUser = getCurrentUser();
    	List<String> ids = Arrays.asList(id.split(","));
    	ywOpenCardHzicbcService.updateBatch(currentUser.getId(), currentUser.getName(), DpStatus.NORMAL.getCode(), ids);
        return ApiResponse.success(true);
    }

    /**
     * @author zhangzhengjian <br/>
     * @Title: modify  <br/>
     * @Description: 修改yw_开卡信息_杭州工行 <br/>
     * @param ywOpenCardHzicbc
     * @return
     * @version V1.0  <br/>
     */
    @ApiOperation(value = "修改yw_开卡信息_杭州工行", response = String.class, httpMethod="POST", tags={"修改"})
    @RequestMapping(value = "modify", method = RequestMethod.POST)
    public ApiResponse modify(@Validated(Update.class) @ModelAttribute YwOpenCardHzicbc ywOpenCardHzicbc) {
    	AbstractSysUser currentUser = getCurrentUser();
    	ywOpenCardHzicbc.setModifier(currentUser.getId()); //统一使用修改人和修改人名称来初始化
    	ywOpenCardHzicbc.setModifierName(currentUser.getName());
    	ywOpenCardHzicbcService.saveUpdateAndDelete(ywOpenCardHzicbc, OperateType.edit);
        return ApiResponse.success(ywOpenCardHzicbc.getId());
    }
    @ApiOperation(value = "修改yw_开卡信息_杭州工行", response = String.class, httpMethod="POST", tags={"修改"})
    @RequestMapping(value = "update", method = RequestMethod.POST)
    public ApiResponse update(@Validated(Update.class) @ModelAttribute  YwOpenCardHzicbcSubVo ywOpenCardHzicbc) {
    	AbstractSysUser currentUser = getCurrentUser();
    	ywOpenCardHzicbc.setModifier(currentUser.getId()); //统一使用修改人和修改人名称来初始化
    	ywOpenCardHzicbc.setModifierName(currentUser.getName());
    	ywOpenCardHzicbcService.updateOpenCardInfo(ywOpenCardHzicbc);
        return ApiResponse.success(ywOpenCardHzicbc.getId());
    }

    /**
     * @author zhangzhengjian <br/>
     * @Title: getById  <br/>
     * @Description: 主键查询yw_开卡信息_杭州工行<br/>
     * @param id
     * @return
     * @version V1.0  <br/>
     */
    @ApiOperation(value = "主键查询yw_开卡信息_杭州工行", response = YwOpenCardHzicbc.class, httpMethod="POST", tags={"主键查询"})
    @ApiImplicitParams({
        @ApiImplicitParam(name = "id", value = "数据主键", paramType="query", required = true, example="1")
    })
    @RequestMapping(value = "getById", method = RequestMethod.POST)
    public ApiResponse getById(String id){
    	if(StringUtils.isBlank(id)) {
    		return ApiResponse.fail(ResultFlagType.PARAM_EMPTY);
    	}
       YwOpenCardHzicbc ywOpenCardHzicbc = ywOpenCardHzicbcService.selectById(id);
       if(null == ywOpenCardHzicbc) {
    	   return ApiResponse.fail(ResultFlagType.MISSING);
       }
       return ApiResponse.success(ywOpenCardHzicbc);
    }
    
    /**
     * @author zhangzhengjian <br/>
     * @Title: list  <br/>
     * @Description: 条件查询yw_开卡信息_杭州工行 <br/>
     * @param ywOpenCardHzicbcExt
     * @return
     * @version V1.0  <br/>
     */
    @ApiOperation(value = "条件查询yw_开卡信息_杭州工行",response = YwOpenCardHzicbc.class, httpMethod="POST", tags={"列表"})
    @RequestMapping(value = "list", method = RequestMethod.POST)
    public ApiResponse list(@ModelAttribute YwOpenCardHzicbcExt ywOpenCardHzicbcExt){
        ywOpenCardHzicbcExt.notDeleted();
        PageVo page = getPage(ywOpenCardHzicbcExt);
        ywOpenCardHzicbcExt.setOrderSql(" created desc");
        int records = ywOpenCardHzicbcService.countByExt(ywOpenCardHzicbcExt);
        page.setRecords(records);
        if (records > 0) {
            List<YwOpenCardHzicbc> dpBaseDataDictionaries = ywOpenCardHzicbcService.selectByExt(ywOpenCardHzicbcExt);
            for (YwOpenCardHzicbc ywOpenCardHzicbc : dpBaseDataDictionaries) {
            	ywOpenCardHzicbc.setHzicbcOpenCardStatusDisplay(cachedDictionaryService.getName(String.valueOf(ywOpenCardHzicbc.getHzicbcOpenCardStatus()), DataDicType.HZICBCOPENCARDSTATUS));
			}
            page.setRows(dpBaseDataDictionaries);
        } else {
            page.setRows(CollectionInitUtil.emptyList());
        }
        return ApiResponse.success(page);
    }

    @ApiOperation(value = "条件查询业务信息",response = YwBusiness.class, httpMethod="POST", tags={"多表查询"})
    @RequestMapping(value = "multiList", method = RequestMethod.POST)
    public ApiResponse multiList(@Validated @ModelAttribute YwBusinessQueryRequest ywBusinessQueryRequest){
    	SysUser currentUser = (SysUser)getCurrentUser();
		PageVo page = getPage(ywBusinessQueryRequest);
		ywBusinessQueryRequest.setBaseWhere();
		ywBusinessQueryRequest.setBankLoan(currentUser.getLoanBank());
		ywBusinessQueryRequest.setTypeData(TypeData.HZICBC.getCode());
//		ywBusinessQueryRequest.setBusiStatusLess(BusiStatus.CHU_SHEN_DAN_CHU_SHEN_ZHONG.getCode());
//		ywBusinessQueryRequest.setBusiStatusMore(BusiStatus.QIAN_SHU_HE_TONG_ZHONG.getCode());
//		ywBusinessQueryRequest.setOpenCardStatusLess(100);
//        YwExtHelper.initExt(ywBusinessQueryRequest, SortFieldType.SUBMIT_TIME);
        ywBusinessQueryRequest.setCodeUnits(currentUser.getCodeUnits());
        ywBusinessQueryRequest.setNeedLimit(true);
        ywBusinessQueryRequest.setOrderSql(" B.INTERVIEW_STATUS ASC ");
        int records = ywBusinessService.countMultiByExt(ywBusinessQueryRequest);
        page.setRecords(records);
        if (records > 0) {
            List<YwBusiness> ywBusinesss = ywBusinessService.selectMultiByExt(ywBusinessQueryRequest);
            ywBusinessVoMapper.mapper(ywBusinesss);
            YwOpenCardHzicbc ywOpenCardHzicbc=null;
            for (YwBusiness ywBusiness : ywBusinesss) {
            	ywOpenCardHzicbc=new YwOpenCardHzicbc();
            	ywOpenCardHzicbc.setBusiId(ywBusiness.getId());
            	ywOpenCardHzicbc.setDpStatus(DpStatus.NORMAL.getCode());
            	ywOpenCardHzicbc=ywOpenCardHzicbcService.selectRefined(ywOpenCardHzicbc);
            	if(ywOpenCardHzicbc!=null){
            		ywBusiness.setRepaymentDate(ywOpenCardHzicbc.getRepaymentDate());
            		ywBusiness.setBankStatementDate(ywOpenCardHzicbc.getBankStatementDate());
            		ywBusiness.setTimeApplyOpencard(ywOpenCardHzicbc.getOpencardSubmitTime());
            		ywBusiness.setOpenCardStatus(ywOpenCardHzicbc.getOpenCardStatus());
            		ywBusiness.setOpenCardStatusDisplay(cachedDictionaryService.getName(String.valueOf(ywBusiness.getOpenCardStatus()), DataDicType.OPEN_CARD_STATUS));
            	}
			}
            page.setRows(ywBusinesss);
        } else {
            page.setRows(CollectionInitUtil.emptyList());
        }
        return ApiResponse.success(page);
	}
    
    
    @ApiOperation(value = "上传卡单照列表",response = YwBusiness.class, httpMethod="POST", tags={"多表查询"})
    @RequestMapping(value = "openCardList", method = RequestMethod.POST)
    public ApiResponse openCardList(@Validated @ModelAttribute YwBusinessQueryRequest ywBusinessQueryRequest){
    	SysUser currentUser = (SysUser)getCurrentUser();
		PageVo page = getPage(ywBusinessQueryRequest);
		ywBusinessQueryRequest.setBaseWhere();
		ywBusinessQueryRequest.setBankLoan(currentUser.getLoanBank());
		ywBusinessQueryRequest.setTypeData(TypeData.HZICBC.getCode());
//		ywBusinessQueryRequest.setBusiStatusLess(BusiStatus.CHU_SHEN_DAN_CHU_SHEN_ZHONG.getCode());
//		ywBusinessQueryRequest.setBusiStatusMore(BusiStatus.QIAN_SHU_HE_TONG_ZHONG.getCode());
        ywBusinessQueryRequest.setCodeUnits(currentUser.getCodeUnits());
//        ywBusinessQueryRequest.setOpenCardStatusOr(1);
//        ywBusinessQueryRequest.setWhereSql("  AND ((B.`OPEN_CARD_STATUS` <100 AND B.`OPEN_CARD_STATUS` !=50) OR B.`OPEN_CARD_STATUS`=9000   "
//        		+ " OR (B.`BUSI_STATUS` >=30 AND B.`BUSI_STATUS` <=50))  ");
        ywBusinessQueryRequest.setWhereSql(" AND (B.OPEN_CARD_STATUS IS NULL OR B.OPEN_CARD_STATUS=2) ");
        ywBusinessQueryRequest.setNeedLimit(true);
        int records = ywBusinessService.countMultiByExt(ywBusinessQueryRequest);
        page.setRecords(records);
        if (records > 0) {
            List<YwBusiness> ywBusinesss = ywBusinessService.selectMultiByExt(ywBusinessQueryRequest);
            ywBusinessVoMapper.mapper(ywBusinesss);
            YwOpenCardHzicbc ywOpenCardHzicbc=null;
            for (YwBusiness ywBusiness : ywBusinesss) {
            	ywOpenCardHzicbc=new YwOpenCardHzicbc();
            	ywOpenCardHzicbc.setBusiId(ywBusiness.getId());
            	ywOpenCardHzicbc.setDpStatus(DpStatus.NORMAL.getCode());
            	ywOpenCardHzicbc=ywOpenCardHzicbcService.selectRefined(ywOpenCardHzicbc);
            	if(ywOpenCardHzicbc!=null){
            		ywBusiness.setRepaymentDate(ywOpenCardHzicbc.getRepaymentDate());
            		ywBusiness.setBankStatementDate(ywOpenCardHzicbc.getBankStatementDate());
            		ywBusiness.setTimeApplyOpencard(ywOpenCardHzicbc.getOpencardSubmitTime());
            		ywBusiness.setOpenCardStatusDisplay(cachedDictionaryService.getName(String.valueOf(ywBusiness.getOpenCardStatus()), DataDicType.OPEN_CARD_STATUS));
            	}
			}
            page.setRows(ywBusinesss);
        } else {
            page.setRows(CollectionInitUtil.emptyList());
        }
        return ApiResponse.success(page);
	}
    
    @ApiOperation(value = "上传卡单照修改开卡状态5",response = YwBusiness.class, httpMethod="POST", tags={"多表查询"})
    @RequestMapping(value = "updateOpenCardStatus", method = RequestMethod.POST)
    public ApiResponse updateOpenCardStatus(@ModelAttribute YwOpenCardHzicbcExt ywOpenCardHzicbcExt){
    	String busiId=ywOpenCardHzicbcExt.getBusiId();
    	SysUser currentUser = (SysUser)getCurrentUser();
    	ywBusinessService.updateOpenCardStatus(busiId,currentUser);
    	
    	return ApiResponse.success(true);
    }
    
    @ApiOperation(value = "申请开卡",response = YwBusiness.class, httpMethod="POST", tags={"多表查询"})
    @RequestMapping(value = "selectOpenCardList", method = RequestMethod.POST)
    public ApiResponse selectOpenCardList(@Validated @ModelAttribute YwBusinessQueryRequest ywBusinessQueryRequest){
    	SysUser currentUser = (SysUser)getCurrentUser();
		PageVo page = getPage(ywBusinessQueryRequest);
		ywBusinessQueryRequest.setBaseWhere();
		ywBusinessQueryRequest.setBankLoan(currentUser.getLoanBank());
		ywBusinessQueryRequest.setTypeData(TypeData.HZICBC.getCode());
//		ywBusinessQueryRequest.setBusiStatusLess(BusiStatus.CHU_SHEN_DAN_CHU_SHEN_ZHONG.getCode());
//		ywBusinessQueryRequest.setBusiStatusNqMore(BusiStatus.YIN_HANG_YI_FANG_KUAN.getCode());
        ywBusinessQueryRequest.setCodeUnits(currentUser.getCodeUnits());
        ywBusinessQueryRequest.setOpenCardStatusOr1(1);
        ywBusinessQueryRequest.setNeedLimit(true);
        int records = ywBusinessService.countMultiByExt(ywBusinessQueryRequest);
        page.setRecords(records);
        if (records > 0) {
            List<YwBusiness> ywBusinesss = ywBusinessService.selectMultiByExt(ywBusinessQueryRequest);
            ywBusinessVoMapper.mapper(ywBusinesss);
            YwOpenCardHzicbc ywOpenCardHzicbc=null;
            for (YwBusiness ywBusiness : ywBusinesss) {
            	ywOpenCardHzicbc=new YwOpenCardHzicbc();
            	ywOpenCardHzicbc.setBusiId(ywBusiness.getId());
            	ywOpenCardHzicbc.setDpStatus(DpStatus.NORMAL.getCode());
            	ywOpenCardHzicbc=ywOpenCardHzicbcService.selectRefined(ywOpenCardHzicbc);
            	if(ywOpenCardHzicbc!=null){
            		ywBusiness.setRepaymentDate(ywOpenCardHzicbc.getRepaymentDate());
            		ywBusiness.setBankStatementDate(ywOpenCardHzicbc.getBankStatementDate());
            		ywBusiness.setTimeApplyOpencard(ywOpenCardHzicbc.getOpencardSubmitTime());
            		ywBusiness.setOpenCardStatus(ywOpenCardHzicbc.getOpenCardStatus());
//            		ywBusiness.setOpenCardStatusDisplay(cachedDictionaryService.getName(String.valueOf(ywBusiness.getOpenCardStatus()), DataDicType.OPEN_CARD_STATUS));
            	}
			}
            page.setRows(ywBusinesss);
        } else {
            page.setRows(CollectionInitUtil.emptyList());
        }
        return ApiResponse.success(page);
	}
    
    
    @ApiOperation(value = "提交开卡最终版",response = YwBusiness.class, httpMethod="POST", tags={"多表查询"})
    @RequestMapping(value = "selectOpenCardDaishenheList", method = RequestMethod.POST)
    public ApiResponse selectOpenCardDaishenheList(@Validated @ModelAttribute YwBusinessQueryRequest ywBusinessQueryRequest){
    	SysUser currentUser = (SysUser)getCurrentUser();
		PageVo page = getPage(ywBusinessQueryRequest);
		ywBusinessQueryRequest.setBaseWhere();
		ywBusinessQueryRequest.setBankLoan(currentUser.getLoanBank());
		ywBusinessQueryRequest.setTypeData(TypeData.HZICBC.getCode());
//		ywBusinessQueryRequest.setBusiStatusLess(BusiStatus.CHU_SHEN_DAN_CHU_SHEN_ZHONG.getCode());
//		ywBusinessQueryRequest.setBusiStatusMore(BusiStatus.QIAN_SHU_HE_TONG_ZHONG.getCode());
        ywBusinessQueryRequest.setCodeUnits(currentUser.getCodeUnits());
//        ywBusinessQueryRequest.setOpenCardStatus(OpenCardStatus.DAI_SHEN_HE.getCode());
        ywBusinessQueryRequest.setWhereSql(" AND (B.OPEN_CARD_STATUS=60 OR B.OPEN_CARD_STATUS=70 OR B.OPEN_CARD_STATUS=50 OR B.OPEN_CARD_STATUS=9000 ) ");
        ywBusinessQueryRequest.setNeedLimit(true);
        int records = ywBusinessService.countMultiByExt(ywBusinessQueryRequest);
        page.setRecords(records);
        if (records > 0) {
            List<YwBusiness> ywBusinesss = ywBusinessService.selectMultiByExt(ywBusinessQueryRequest);
            ywBusinessVoMapper.mapper(ywBusinesss);
            YwOpenCardHzicbc ywOpenCardHzicbc=null;
            for (YwBusiness ywBusiness : ywBusinesss) {
            	ywOpenCardHzicbc=new YwOpenCardHzicbc();
            	ywOpenCardHzicbc.setBusiId(ywBusiness.getId());
            	ywOpenCardHzicbc.setDpStatus(DpStatus.NORMAL.getCode());
            	ywOpenCardHzicbc=ywOpenCardHzicbcService.selectRefined(ywOpenCardHzicbc);
            	if(ywOpenCardHzicbc!=null){
            		ywBusiness.setRepaymentDate(ywOpenCardHzicbc.getRepaymentDate());
            		ywBusiness.setBankStatementDate(ywOpenCardHzicbc.getBankStatementDate());
            		ywBusiness.setTimeApplyOpencard(ywOpenCardHzicbc.getOpencardSubmitTime());
            		ywBusiness.setOpenCardStatus(ywOpenCardHzicbc.getOpenCardStatus());
            		ywBusiness.setOpenCardStatusDisplay(cachedDictionaryService.getName(String.valueOf(ywOpenCardHzicbc.getOpenCardStatus()), DataDicType.OPEN_CARD_STATUS));
            	}
			}
            page.setRows(ywBusinesss);
        } else {
            page.setRows(CollectionInitUtil.emptyList());
        }
        return ApiResponse.success(page);
	}
    
    /**
     * @param ywBusinessQueryRequest
     * @return
     */
    @ApiOperation(value = "开卡进度查询",response = YwBusiness.class, httpMethod="POST", tags={"多表查询"})
    @RequestMapping(value = "selectOpenCardProgressList", method = RequestMethod.POST)
    public ApiResponse selectOpenCardProgressList(@Validated @ModelAttribute YwBusinessQueryRequest ywBusinessQueryRequest){
    	SysUser currentUser = (SysUser)getCurrentUser();
		PageVo page = getPage(ywBusinessQueryRequest);
		ywBusinessQueryRequest.setBaseWhere();
		ywBusinessQueryRequest.setBankLoan(currentUser.getLoanBank());
		ywBusinessQueryRequest.setTypeData(TypeData.HZICBC.getCode());
        ywBusinessQueryRequest.setCodeUnits(currentUser.getCodeUnits());
        ywBusinessQueryRequest.setOpenCardStatusLess(OpenCardStatus.TUI_HUI.getCode());
        ywBusinessQueryRequest.setNeedLimit(true);
        int records = ywBusinessService.countMultiByExt(ywBusinessQueryRequest);
        page.setRecords(records);
        if (records > 0) {
            List<YwBusiness> ywBusinesss = ywBusinessService.selectMultiByExt(ywBusinessQueryRequest);
            ywBusinessVoMapper.mapper(ywBusinesss);
            YwOpenCardHzicbc ywOpenCardHzicbc=null;
            for (YwBusiness ywBusiness : ywBusinesss) {
            	ywOpenCardHzicbc=new YwOpenCardHzicbc();
            	ywOpenCardHzicbc.setBusiId(ywBusiness.getId());
            	ywOpenCardHzicbc.setDpStatus(DpStatus.NORMAL.getCode());
            	ywOpenCardHzicbc=ywOpenCardHzicbcService.selectRefined(ywOpenCardHzicbc);
            	if(ywOpenCardHzicbc!=null){
            		ywBusiness.setRepaymentDate(ywOpenCardHzicbc.getRepaymentDate());
            		ywBusiness.setBankStatementDate(ywOpenCardHzicbc.getBankStatementDate());
            		ywBusiness.setTimeApplyOpencard(ywOpenCardHzicbc.getOpencardSubmitTime());
            		ywBusiness.setOpenCardStatus(ywOpenCardHzicbc.getOpenCardStatus());
            		ywBusiness.setOpenCardStatusDisplay(cachedDictionaryService.getName(String.valueOf(ywOpenCardHzicbc.getOpenCardStatus()), DataDicType.OPEN_CARD_STATUS));
            		ywBusiness.setHzicbcOpenCardStatusDisplay(cachedDictionaryService.getName(String.valueOf(ywOpenCardHzicbc.getHzicbcOpenCardStatus()), DataDicType.HZICBCOPENCARDSTATUS));
            		ywBusiness.setModified(ywOpenCardHzicbc.getModified());
            	}
			}
            page.setRows(ywBusinesss);
        } else {
            page.setRows(CollectionInitUtil.emptyList());
        }
        return ApiResponse.success(page);
	}
    
    @ApiOperation(value = "线下提交开卡",response = YwBusiness.class, httpMethod="POST", tags={"多表查询"})
    @RequestMapping(value = "selectOpenCardLineList", method = RequestMethod.POST)
    public ApiResponse selectOpenCardLineList(@Validated @ModelAttribute YwBusinessQueryRequest ywBusinessQueryRequest){
    	SysUser currentUser = (SysUser)getCurrentUser();
		PageVo page = getPage(ywBusinessQueryRequest);
		ywBusinessQueryRequest.setBaseWhere();
		ywBusinessQueryRequest.setBankLoan(currentUser.getLoanBank());
		ywBusinessQueryRequest.setTypeData(TypeData.HZICBC.getCode());
        ywBusinessQueryRequest.setCodeUnits(currentUser.getCodeUnits());
        ywBusinessQueryRequest.setOpenCardStatus(OpenCardStatus.XIAN_XIA_CHU_LI.getCode());
        ywBusinessQueryRequest.setNeedLimit(true);
        int records = ywBusinessService.countMultiByExt(ywBusinessQueryRequest);
        page.setRecords(records);
        if (records > 0) {
            List<YwBusiness> ywBusinesss = ywBusinessService.selectMultiByExt(ywBusinessQueryRequest);
            ywBusinessVoMapper.mapper(ywBusinesss);
            YwOpenCardHzicbc ywOpenCardHzicbc=null;
            for (YwBusiness ywBusiness : ywBusinesss) {
            	ywOpenCardHzicbc=new YwOpenCardHzicbc();
            	ywOpenCardHzicbc.setBusiId(ywBusiness.getId());
            	ywOpenCardHzicbc.setDpStatus(DpStatus.NORMAL.getCode());
            	ywOpenCardHzicbc=ywOpenCardHzicbcService.selectRefined(ywOpenCardHzicbc);
            	if(ywOpenCardHzicbc!=null){
            		ywBusiness.setRepaymentDate(ywOpenCardHzicbc.getRepaymentDate());
            		ywBusiness.setBankStatementDate(ywOpenCardHzicbc.getBankStatementDate());
            		ywBusiness.setTimeApplyOpencard(ywOpenCardHzicbc.getOpencardSubmitTime());
            		ywBusiness.setOpenCardStatus(ywOpenCardHzicbc.getOpenCardStatus());
            		ywBusiness.setOpenCardStatusDisplay(cachedDictionaryService.getName(String.valueOf(ywOpenCardHzicbc.getOpenCardStatus()), DataDicType.OPEN_CARD_STATUS));
            	}
			}
            page.setRows(ywBusinesss);
        } else {
            page.setRows(CollectionInitUtil.emptyList());
        }
        return ApiResponse.success(page);
	}
}
